package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:char(11);unique;not null;comment:'手机号'"`
	Password string `gorm:"type:char(32);not null;comment:'密码'"`
	Info     string `gorm:"type:varchar(170);not null;comment:'简介'"`
}

func (u *User) GetUserInfo(db *gorm.DB, mobile string) error {
	err := db.Model(&User{}).Where("mobile = ?", mobile).Find(&u).Error
	return err
}
